<template>
  <div>
    <sticky-top>
      <div class="title">
        <!-- <span>{{ isCreate ? '创建异常信息' : '更新异常信息' }}</span> -->
        <span>异常信息</span>
        <span class="back" @click="back"> <i class="iconfont icon-fanhui"></i> 返回 </span>
        <el-divider></el-divider>
      </div>
    </sticky-top>
    <div class="container">
      <div class="wrap">
        <el-form :model="form" status-icon ref="form" label-width="100px" @submit.native.prevent>
          <el-row>
            <el-col :lg="16" :md="20" :sm="24" :xs="24">
              <el-form-item label="序号" prop="collector_id">
                <el-input size="medium" v-model="form.collector_id" :disabled="true"></el-input>
              </el-form-item>
              <el-form-item label="采集器名称" prop="collector_name">
                <el-input size="medium" v-model="form.collector_name" :disabled="true"></el-input>
              </el-form-item>
              <el-form-item label="部门名称" prop="dwmc">
                <el-input size="medium" v-model="form.dwmc" :disabled="true"></el-input>
              </el-form-item>
              <el-form-item label="网关名称" prop="bgateway_name">
                <el-input size="medium" v-model="form.bgateway_name" :disabled="true"></el-input>
              </el-form-item>
              <el-form-item label="采集器电量" prop="collector_power">
                <el-input size="medium" v-model="form.collector_power" :disabled="true"
                  ><template slot="append">%</template></el-input
                >
              </el-form-item>
              <el-form-item label="温度范围" prop="t">
                <el-input style="width: 40%" size="medium" v-model="form.thigh" :disabled="true"
                  ><template slot="append">℃</template></el-input
                ><span style="font-size: 50px; color: #777">-</span>
                <el-input style="width: 40%" size="medium" v-model="form.tlower" :disabled="true"
                  ><template slot="append">℃</template></el-input
                >
              </el-form-item>
              <el-form-item label="采集温度值" prop="tvalue">
                <el-input size="medium" v-model="form.tvalue" :disabled="true"
                  ><template slot="append">℃</template></el-input
                >
              </el-form-item>
              <el-form-item label="温度结果" prop="tresult">
                <el-input size="medium" v-model="form.tresult" :disabled="true"></el-input>
              </el-form-item>
              <el-form-item label="湿度范围" prop="h">
                <el-input style="width: 40%" size="medium" v-model="form.hhigh" :disabled="true"
                  ><template slot="append">RH%</template></el-input
                ><span style="font-size: 50px; color: #777">-</span>
                <el-input style="width: 40%" size="medium" v-model="form.hlower" :disabled="true"
                  ><template slot="append">RH%</template></el-input
                >
              </el-form-item>
              <el-form-item label="采集湿度值" prop="hvalue">
                <el-input size="medium" v-model="form.hvalue" :disabled="true"
                  ><template slot="append">RH%</template></el-input
                >
              </el-form-item>
              <el-form-item label="湿度结果" prop="hresult">
                <el-input size="medium" v-model="form.hresult" :disabled="true"></el-input>
              </el-form-item>
              <el-form-item label="采集时间" prop="collector_time">
                <el-input size="medium" v-model="form.collector_time" :disabled="true"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
    </div>
  </div>
</template>

<script>
import BCollection from '@/model/BCollection'

export default {
  components: {},
  props: {
    isCreate: {
      type: Boolean,
      default: false,
    },
    BCollectionId: {
      type: String,
      default: null,
    },
  },
  data() {
    return {
      form: {},
    }
  },
  watch: {},
  async mounted() {
    const res = await BCollection.getDetail(this.BCollectionId)
    this.form = res
  },
  methods: {
    back() {
      this.$emit('editClose')
    },
  },
}
</script>

<style lang="scss" scoped>
.el-divider--horizontal {
  margin: 0;
}

.container {
  .title {
    height: 59px;
    line-height: 59px;
    color: $parent-title-color;
    font-size: 16px;
    font-weight: 500;
    text-indent: 40px;

    .back {
      float: right;
      margin-right: 40px;
      cursor: pointer;
    }
  }

  .wrap {
    padding: 20px;
  }

  .submit {
    float: left;
  }
}

.my-autocomplete {
  li {
    line-height: normal;
    padding: 7px;
    display: inline-flex;
    align-content: space-around;
    .name {
      text-overflow: ellipsis;
      overflow: hidden;
    }
    .id {
      margin-right: 15px;
      font-size: 12px;
      color: #b4b4b4;
    }

    .highlighted .addr {
      color: #ddd;
    }
  }
}
</style>
